From dfe32780e0862515eb4b2ddebae9fcfb2198704a Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 13 Sep 2022 23:18:40 -0700 Subject: currency formatting helpers --- src/routes/[username]/transactions/+page.svelte | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/routes/[username]/transactions') diff --git a/src/routes/[username]/transactions/+page.svelte b/src/routes/[username]/transactions/+page.svelte index 9bc67fda..5a132394 100644 --- a/src/routes/[username]/transactions/+page.svelte +++ b/src/routes/[username]/transactions/+page.svelte @@ -2,6 +2,7 @@ import { AppHeader } from '$comp'; import { user, newPayment } from '$lib/store'; import { t } from '$lib/translations'; + import { f, s } from "$lib/utils"; $newPayment = false; @@ -28,16 +29,11 @@
{tx.amount > 0 ? '+' : ''}{new Intl.NumberFormat('en-US', { - style: 'currency', - currency: tx.currency - }).format(tx.amount * (tx.rate / 100000000))} + >{tx.amount > 0 ? '+' : ''}{f(tx.amount * (tx.rate / 100000000), tx.currency)} {tx.amount > 0 ? '+' : ''}{new Intl.NumberFormat('en-US', { - maximumFractionDigits: 0 - }).format(tx.amount)} + >{tx.amount > 0 ? '+' : ''}{s(tx.amount)} SAT
-- cgit v1.2.3